import unittest
from Polygon import Polygon

class LevelTests(unittest.TestCase):

    def setUp(self):
        unittest.TestCase.setUp(self)
        input = [(0,0),(10,0),(5,5)]        
        self.poly3 = Polygon( input )

    def testCreateTriangularPolygon3(self):
        out = len( self.poly3.vertices )
        self.assertEqual( out , 3  )

    def testPointWithinPolygon3(self):
        point = (5,2)
        out = self.poly3.intersects( point )
        self.assertTrue( out ) 

    def testPointOutsidePolygon3(self):
        point = (1,1)
        out = self.poly3.intersects( point )
        self.assertFalse( out )        

    def testPointOnEdgePolygon3(self):
        point = (5,0.0)
        out = self.poly3.intersects( point )
        self.assertTrue( out ) 

if __name__ == '__main__':
    unittest.main()